<#include "/admin/inc/ctx.html">
<link href="${ctx }/webapp/static/lib/treetable/jquery.treetable.css" rel="stylesheet" type="text/css" media="screen" />
<link href="${ctx }/webapp/static/lib/treetable/jquery.treetable.theme.default.css" rel="stylesheet" type="text/css" media="screen"/>
<script src="${ctx }/webapp/static/lib/treetable/jquery.treetable.js" type="text/javascript"> </script>
<script type="text/javascript">
$(function () {
    var option = {
    		theme:'vsStyle',
    		column:2,
    		expandable:true
    };
    $('#channelTable',navTab.getCurrentPanel()).treetable(option);//根据表格id来初始化
    $("#channelTable",navTab.getCurrentPanel()).treetable("expandAll");
});
</script>
<style>
#channelTable th{border-top: 1px solid #B8D0D6;font-weight: bolder;}
#channelTable th,#channelTable td{border-left: solid 1px #E7E7E7;border-right: 1px solid #E7E7E7;border-bottom: 1px solid #E7E7E7;line-height: 22px;background: white;}
</style>

<#macro _channel_table records>
 <#list records as child>
	<tr data-tt-id='${child.id}' data-tt-parent-id='${child.pId}' target="id" rel="${child.id }">
		<td><input type="checkbox" name="ids" value="${child.id }" /></td>
		<td>${child.id }</td>
		<td>${child.name }</td>
		<td>${child.code }</td>
		<td>
		    <#if child.isNav==1>
			     是
		   <#else>
			    否
		   </#if>
		</td>
		<td>${child.sort }</td>
		<td align="center">
		    <a title="栏目静态" target="ajaxTodo" callback="ajaxTodoDone"  href="${ctx}/admin/html/channel?ids=${child.id }"><i class="fa fa-book"></i>栏目静态</a>
			<a title="内容静态"  href="${ctx }/admin/html/create?ids=${child.id }"><i class="fa fa-sticky-note"></i>内容静态</a> 
			<a title="全部静态"  href="${ctx}/admin/html/create?ids=${child.id }" ><i class="fa fa-server"></i>全部静态</a>
		</td>
	</tr>
    <@_channel_table records=child.children />
 </#list> 
</#macro>

<form id="pagerForm" method="post" action="${ctx}/admin/html/treePage">
	<input type="hidden" name="pageNum" value="1" />
</form>
<div class="pageContent">
<div class="panelBar" style="margin-top: 1px;">
		<ul class="toolBar">
		    <@shiro.hasPermission name="admin:module:form">
		    <li><a href="${ctx}/admin/html/index" target="selectedTodo"><i class="fa fa-home"></i>首页静态</a></li>
			</@shiro.hasPermission>
			<@shiro.hasPermission name="admin:module:form">
		    <li><a href="${ctx}/admin/html/channel" target="selectedTodo"><i class="fa fa-book"></i>栏目静态</a></li>
			</@shiro.hasPermission>
			<@shiro.hasPermission name="admin:module:form">
		    <li><a href="${ctx}/admin/html/content" target="selectedTodo"><i class="fa fa-sticky-note"></i>内容静态</a></li>
			</@shiro.hasPermission>
			<@shiro.hasPermission name="admin:module:form">
		    <li><a href="${ctx}/admin/html/all" target="selectedTodo"><i class="fa fa-server"></i>全部静态</a></li>
			</@shiro.hasPermission>
			<li class="line">line</li>
		</ul>
	</div>
	<div layoutH="0" style="margin-top: 1px;">
		<table id="channelTable" style="margin-top: 0;">
			<thead>
				<tr>
				    <th width="2%"><input type="checkbox" group="ids" class="checkboxCtrl"></th>
				    <th width="3%">编号</th>
					<th width="10%">名称</th>
					<th width="5%">页面标识</th>
					<th width="3%">是否导航</th>	
					<th width="3%">排序</th>
					<th width="10%">操作</th>
				</tr>
			</thead>
			<tbody>
				<#list pageData as bean> 
				        <#if bean.pId?? && bean.pId==1>
				        <tr data-tt-id='${bean.id}' target="id" rel="${bean.id }">
							<td><input type="checkbox" name="ids" value="${bean.id }" /></td>
							<td>${bean.id }</td>
							<td>${bean.name }</td>
							<td>${bean.code }</td>
							<td>
							 <#if bean.isNav==1>
							             是
							 <#else>
							            否
							 </#if>
							</td>
							<td>${bean.sort }</td>
							<td align="center">
							    <a title="栏目静态"  target="ajaxTodo" callback="ajaxTodoDone" href="${ctx}/admin/html/channel?ids=${bean.id }"><i class="fa fa-book"></i>栏目静态</a>
								<a title="内容静态"  target="ajaxTodo" href="${ctx }/admin/html/content?ids=${bean.id}"><i class="fa fa-sticky-note"></i>内容静态</a> 
								<a title="全部静态"  target="ajaxTodo" href="${ctx}/admin/html/all?ids=${bean.id }"><i class="fa fa-server"></i>全部静态</a>
							</td>
						</tr>
				          <@_channel_table records=bean.children />
						</#if>
				</#list>
			</tbody>
		</table>
	</div>
</div>
